<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
	xmlns:c="http://xmlns.jcp.org/jsf/composite"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="-1" />
	<title>ST Manager</title>
	<link href="imagem/favicon.png" type="image/png" rel="shortcut icon" />
	<link type="text/css" rel="stylesheet"
		href="#{request.contextPath}/css/skytef.css" />

</h:head>
<h:body styleClass="body">
	<ui:include src="header.xhtml" />
	<div class="central">
		<h:form id="form" style="padding-top: 1px">
			<p:messages />
			<p:panel style="background:none;border:0px">
			<h:outputText value="Tarefa : " style="font-weight:bold;font-size: 18px; "/>
			<h:outputText value="#{ConsultaTarefaBean.tarefa.id}" style="font-weight:bold;font-size: 18px;"/>
			<p:spacer width="450" height="10" />
			<h:outputText value="Status : " style="font-weight:bold;font-size: 18px;" />
			<h:outputText value="#{ConsultaTarefaBean.tarefa.status}" style="font-weight:bold;font-size: 18px;" />
			</p:panel>
			<p:panel id = "hist" header="Informações do Histórico">
				<h:outputText value="Cnpj :" style="font-size: 14px;font-weight:bold;"/>
				<h:outputText value="#{ConsultaTarefaBean.tarefa.cnpj}" style="font-size: 14px;" />
				<p:spacer width="150" height="10" />
				<h:outputText value="Tipo Cliente :"
					style="font-size: 14px;font-weight:bold;" />
				<h:outputText value="#{ConsultaTarefaBean.tarefa.tipoCliente}"
					style="font-size: 14px;" />
				<p:spacer width="100" height="10" />
				<h:outputText value="Contato:"
					style="font-size: 14px;font-weight:bold;" />
				<h:outputText value="#{ConsultaTarefaBean.tarefa.nome}"
					style="font-size: 14px;" />
			
				<br />
				<p:separator id="separator0" />
			
				<h:outputText value="Responsável Final:"
					style="font-size: 14px;font-weight:bold;" />
				<h:outputText value="#{ConsultaTarefaBean.tarefa.nome}"
					style="font-size: 14px;" />
				<p:spacer width="450" height="10" />
				<h:outputText value="Motivo de Suporte:"
					style="font-size: 14px;font-weight:bold;" />
				<h:outputText value="#{ConsultaTarefaBean.tarefa.motivoSuporte}"
					style="font-size: 14px;" />
				<br />
				<br />
				<h:outputText value="Tipo Suporte :"
					style="font-size: 14px;font-weight:bold;" />
				<h:outputText value="#{ConsultaTarefaBean.tarefa.tipoSuporte}"
					style="font-size: 14px;" />
				<p:spacer width="43.5%" height="10" />
				<h:outputText value="Forma:"
					style="font-size: 14px;font-weight:bold;" />
				<h:outputText value="#{ConsultaTarefaBean.tarefa.forma}"
					style="font-size: 14px;" />
				<p:panel style="margin-top:3%">
					<h:outputText value="Descrição do Atendimento:"
						style="font-size: 14px;font-weight:bold;" />
					<h:outputText style="font-size: 14px;"
						value="#{ConsultaTarefaBean.tarefa.descricao}" />
				</p:panel>
				<p:panel  style="text-align: right; margin-top: 0% ; border: 0px"
						  visible="#{HistoricoTarefaBean.button}" >
					<p:commandButton id="btReabrir"
						actionListener="#{HistoricoTarefaBean.reabrirTarefa()}"
						style="font-size: 14px;" value="Reabrir" ajax="false" />
				</p:panel>
			</p:panel>

			<p:panel resizable="false" id="clientePanel"
				visible="#{HistoricoTarefaBean.visible}"
				style="width: 99.3%;height:500%; margin-top:10px;" ajax="false">
				<h:panelGrid style="border:0px;" columns="6">
					<h:outputText value="Contato: "
						style="font-size: 14px; font-weight:bold;" />
					<p:selectOneMenu
						value="#{HistoricoTarefaBean.historico.contato_id}">
						<f:selectItems value="#{HistoricoTarefaBean.contatos}"
							var="contatos" itemLabel="#{contatos.nome}"
							itemValue="#{contatos.contatoId}" style="font-size: 10px;" />
					</p:selectOneMenu>
					<p:commandButton icon="ui-icon-plus" update="form:clientePanel"
						oncomplete="PF('clienteDialog').show()"
						actionListener="#{HistoricoTarefaBean.cadContato}"
						style="font-size: 14px;" global="false" />
					<h:outputText value="Motivo Suporte: "
						style="font-size: 14px; font-weight:bold;" />
					<p:selectOneMenu
						value="#{HistoricoTarefaBean.historico.motivoSuporte_id}">
						<f:selectItems
							value="#{HistoricoTarefaBean. getListMotivoSuporteEntities()}"
							var="mot" itemLabel="#{mot.motivo}" itemValue="#{mot.id}"
							style="font-size: 10px;" />
					</p:selectOneMenu>
					<p:commandButton icon="ui-icon-plus" update="form:motivoDlg"
						oncomplete="PF('motivoDialog').show()" style="font-size: 14px;" />
				</h:panelGrid>
				<br />
				<h:panelGrid columns="6" style="border:0px">
					<h:outputText value="Subcategorias de Erros: "
						style="font-size: 14px; font-weight:bold;" />
					<p:selectOneMenu value="#{HistoricoTarefaBean.historico.suberro_id}">
						<f:selectItems value="#{HistoricoTarefaBean. getListSubErroEntities()}"
							var="erro" itemLabel="#{erro.nome}" itemValue="#{erro.id}"
							style="font-size: 10px;" />
					</p:selectOneMenu>
					<h:outputText value=" Forma: "
						style="font-size: 14px; font-weight:bold;" />
					<p:selectOneMenu value="#{HistoricoTarefaBean.historico.forma}"
						style="font-size: 12px">
						<f:selectItem itemLabel="Acesso Remoto" itemValue="Acesso remoto" />
						<f:selectItem itemLabel="Telefônico" itemValue="Telefonico" />
						<f:selectItem itemLabel="A/T" itemValue="A/T" />
					</p:selectOneMenu>
					<h:outputText value=" Tipo de Suporte: "
						style="font-size: 14px; font-weight:bold;" />
					<p:selectOneMenu id="tipoSuporte" style="font-size: 12px;"
						value="#{HistoricoTarefaBean.historico.tipoSuporte}">
						<f:selectItem itemLabel="Instalação" itemValue="Instalacao" />
						<f:selectItem itemLabel="Atendimento" itemValue="Atendimento" />
						<f:selectItem itemLabel="Skype" itemValue="Skype" />
						<f:selectItem itemLabel="Email" itemValue="Email" />
					</p:selectOneMenu>
				</h:panelGrid>

				<p:dialog header="Cadastro de Motivo" widgetVar="motivoDialog"
					resizable="false" id="motivoDlg" showEffect="fade"
					hideEffect="explode" modal="true">
					<h:panelGrid columns="2" cellpadding="4">
						<h:outputText value="Motivo: "
							style="font-size: 14px;font-weight:bold; " />
						<h:inputText value="#{HistoricoTarefaBean.motivo}"
							style="font-weight:bold; font-size: 14px;">
							<f:validateLength minimum="5" />
						</h:inputText>
						<p:commandButton value="Cadastrar" icon="ui-icon-plus"
							update="form:clientePanel" ajax="false"
							actionListener="#{HistoricoTarefaBean.cadastrarMotivo}"
							style="font-size: 14px;" />
					</h:panelGrid>
				</p:dialog>

				<p:dialog header="Cadastro de Contato" widgetVar="clienteDialog"
					resizable="false" id="clienteDlg" showEffect="fade"
					hideEffect="explode" modal="true">
					<h:panelGrid columns="2" cellpadding="4">
						<h:outputText value="Nome: "
							style="font-size: 14px;font-weight:bold; " />
						<h:inputText value="#{ContatoBean.nome}"
							style="font-weight:bold; font-size: 14px;" />
						<h:outputText value="Telefone: "
							style="font-size: 14px;font-weight:bold;" />
						<p:inputText value="#{ContatoBean.telefone}"
							style="font-weight:bold; font-size: 14px; " />
						<h:outputText value="Email: "
							style="font-size: 14px;font-weight:bold;" />
						<p:inputText value="#{ContatoBean.email}"
							style="font-weight:bold; font-size: 14px; " />
						<p:commandButton ajax="false" value="Salvar" icon="ui-icon-plus"
							update="form:clientePanel"
							actionListener="#{ContatoBean.cadastroContatoHistoricoTarefa}"
							style="font-size: 14px;" />
					</h:panelGrid>
				</p:dialog>
				<br />

				<h:outputText value="Descrição da reabertura: "
					style="font-size: 14px;font-weight:bold;" />
				<div style="padding-left: 200px">
					<p:inputTextarea rows="10" cols="80"
						style="font-size: 14px;width:50%"
						value="#{HistoricoTarefaBean.historico.descricao}" />
				</div>
				<h:panelGrid columns="4" cellpadding="4" style="margin-left:75%">
					<h:outputText value="Status: "
						style="font-size: 14px;font-weight:bold;" />
					<p:selectOneMenu id="status" style="font-size: 14px;"
						value="#{HistoricoTarefaBean.historico.status}">
						<f:selectItem itemLabel="Pendente" itemValue="P" />
						<f:selectItem itemLabel="Concluído" itemValue="C" />
					</p:selectOneMenu>
					<p:commandButton id="btSalvar" style="font-size: 14px;"
						value="Salvar" ajax="false"
						actionListener="#{HistoricoTarefaBean.salvarHistorico}" update="form:hist" />
				</h:panelGrid>
			</p:panel>
		</h:form>
	</div>
	<p:panel id="cm" style="background: transparent; border: 0px;">
		<ui:include src="#{DashboardBean.currentMenu}" />
	</p:panel>
</h:body>
</html>
